#include "systick.h"


static uint32 systick_cnt;

void task_1ms(void)
{
	systick_cnt++;
}

uint32 get_systick(void)
{
	return systick_cnt;
}


bool task_10ms(void)
{
	static uint32 now_tick;
	static uint32 last_tick;
	now_tick = get_systick();
	if(now_tick - last_tick > 10)
	{
		last_tick = now_tick;
		return true;
	}
	else
	{
		return false;
	}
}

void delay_ms(uint16 time)
{
	uint16 tick_now;
	tick_now = get_systick();
	while(get_systick() - tick_now < time);
}

